package org.lanqiao.ssm.common.quartz.jobManage;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
	public static void main(String[] args) {
		ApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring-manage.xml");
		QuartzUtil quartzTest = context.getBean("quartzUtil", QuartzUtil.class);
		// quartzTest.startSchedule("job2","jGroup2",""0/5 * * * * ?"");
		quartzTest.start();

		// try {
		// Thread.sleep(20000);
		// } catch (InterruptedException e) {
		// e.printStackTrace();
		// }
		// System.out.println("开始暂停job2任务");
		// quartzTest.pauseJob("job2", "jGroup2");
		// try {
		// Thread.sleep(20000);
		// } catch (InterruptedException e) {
		// e.printStackTrace();
		// }
		// System.out.println("验证暂停之后start()还有没有作用");
		// quartzTest.start();
		// System.out.println("验证暂停之后start()没有作用");
		// try {
		// Thread.sleep(20000);
		// } catch (InterruptedException e) {
		// e.printStackTrace();
		// }
		// System.out.println("开始恢复job1任务");
		// quartzTest.resumeJob("job1", "jGroup1");
		// quartzTest.start();

		// try {
		// Thread.sleep(10000);
		// } catch (InterruptedException e) {
		// e.printStackTrace();
		// }
		System.out.println("开始改变job1任务时间");
		quartzTest.rescheduleJob("trigger1", "tGroup1", "0/10 * * * * ?");
		quartzTest.start();

	}
}